<?php

function returnToPage($path, $return=null)
{
    $header = "Location:".$path;
    if (is_array($return)) {
        if (strchr($header, '?')) {
            $header .= '&';
        } else {
            $header .= '?';
        }
        $header .= 'msg='.$return['msg'];
        // $header = rtrim($header, '&');
    }
    header($header);
    exit;
}
function checkSession()
{
    session_start();
    if (isset($_SESSION['user']) && !empty($_SESSION['user'])) {
        return true;
    } else {
        return false;
    }
}
